import request from '@/utils/request'

const API = {
  SKULISTBYPAGE_URL: '/admin/product/list/',
  SKUONSALE: '/admin/product/onSale/',
  SKUCANCELSALE: '/admin/product/cancelSale/',
  REMOVESKU_URL: '/admin/product/deleteSku/',
}

export const reqSkuListByPage = async (page: number, limit: number) => {
  return await request.get<any, any>(API.SKULISTBYPAGE_URL + `${page}/${limit}`)
}

export const reqOnSaleSKU = async (skuId: number) =>
  await request.get<any, any>(API.SKUONSALE + skuId)

export const reqCancelSaleSKU = async (skuId: number) =>
  await request.get<any, any>(API.SKUCANCELSALE + skuId)

export const reqRemoveSku = async (skuId: number) =>
  await request.delete<any, any>(API.REMOVESKU_URL + skuId)
